home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
MPW_TOOL
/
TOOLS
/
TOOLS_WI
/
ICON_8
/
ICONX_FO
/
IDATA.C
< prev
next >
Wrap
Text File
|
1990-03-02
|
9KB
|
413 lines
/*
* Various interpreter data tables.
*/
#include "::h:config.h"
#include "::h:rt.h"
#include "rproto.h"
struct b_proc Bnoproc;
/*
* External declarations for function blocks.
*/
char *fncnames[] = {
#ifdef PreProcess
/* define(FncDef,"$1"`,') */
/* define(FncDefV,"$1"`,') */
/* include(../h/fdefs.h) /* */
/* */
/* undefine(`FncDef') */
/* undefine(`FncDefV') */
/* */
#else /* PreProcess */
#define FncDef(p,n) Lit(p),
#define FncDefV(p) Lit(p),
#include "::h:fdefs.h"
#undef FncDef
#undef FncDefV
#endif /* PreProcess */
0
};
int fnsize = (sizeof(fncnames) / sizeof(char*)) - 1;
#ifdef PreProcess
/* define(FncDef,extern struct b_proc B$1;) */
/* define(FncDefV,extern struct b_proc B$1;) */
/* include(../h/fdefs.h) /* */
/* */
/* undefine(`FncDef') */
/* undefine(`FncDefV') */
/* */
#else /* PreProcess */
#define FncDef(p,n) extern struct b_proc Cat(B,p);
#define FncDefV(p) extern struct b_proc Cat(B,p);
#include "::h:fdefs.h"
#undef FncDef
#undef FncDefV
#endif /* PreProcess */
#ifdef PreProcess
/* define(OpDef,extern struct b_proc B$1;) */
/* include(../h/odefs.h) /* */
/* undefine(`OpDef') */
/* */
#else /* PreProcess */
#define OpDef(p,n,s) extern struct b_proc Cat(B,p);
#include "::h:odefs.h"
#undef OpDef
#endif /* PreProcess */
extern struct b_proc Bbscan;
extern struct b_proc Bcreate;
extern struct b_proc Bescan;
extern struct b_proc Bfield;
extern struct b_proc Blimit;
extern struct b_proc Bllist;
/*
* Array of addresses of function blocks.
*/
struct b_proc *functab[] = {
#ifdef PreProcess
/* define(FncDef,&B$1`,') */
/* define(FncDefV,&B$1`,') */
/* include(../h/fdefs.h) /* */
/* undefine(`FncDef') */
/* undefine(`FncDefV') */
/* */
#else /* PreProcess */
#define FncDef(p,n) Cat(&B,p),
#define FncDefV(p) Cat(&B,p),
#include "::h:fdefs.h"
#undef FncDef
#undef FncDefV
#endif /* PreProcess */
0
};
int ftsize = (sizeof(functab) / sizeof(struct b_proc *)) - 1;
/*
* When an opcode n has a subroutine call associated with it, the
* nth word here is the routine to call.
*/
int (*optab[])() = {
err,
#ifdef PreProcess
/* define(OpDef,O$1`,') */
/* include(../h/odefs.h) /* */
/* undefine(`OpDef') */
/* */
#else /* PreProcess */
#define OpDef(p,n,s) Cat(O,p),
#include "::h:odefs.h"
#undef OpDef
#endif /* PreProcess */
Obscan,
err,
err,
err,
err,
err,
Ocreate,
err,
err,
err,
err,
Oescan,
err,
Ofield
};
#ifdef TraceBack
struct b_proc *opblks[] = {
NULL,
#ifdef PreProcess
/* define(OpDef,&B$1`,') */
/* include(../h/odefs.h) /* */
/* undefine(`OpDef') */
/* */
#else /* PreProcess */
#define OpDef(p,n,s) Cat(&B,p),
#include "::h:odefs.h"
#undef OpDef
#endif /* PreProcess */
&Bbscan,
NULL,
NULL,
NULL,
NULL,
NULL,
&Bcreate,
NULL,
NULL,
NULL,
NULL,
&Bescan,
NULL,
&Bfield,
NULL,
NULL,
NULL,
NULL,
NULL,
&Blimit,
&Bllist,
NULL,
NULL,
NULL
};
#endif /* TraceBack */
#ifdef StrInvoke
/*
* Array of names and corresponding functions.
*/
struct pstrnm pntab[] = {
#ifndef BoundFunctions
#ifdef PreProcess
/* define(FncDef,"$1"`,' &B$1`,') */
/* define(FncDefV,"$1"`,' &B$1`,') */
/* include(../h/fdefs.h) /* */
/* undefine(`FncDef') */
/* undefine(`FncDefV') */
/* */
#else /* PreProcess */
#define FncDef(p,n) Lit(p), Cat(&B,p),
#define FncDefV(p) Lit(p), Cat(&B,p),
#include "::h:fdefs.h"
#undef FncDef
#undef FncDefV
#endif /* PreProcess */
#endif /* BoundFunctions */
#ifdef PreProcess
/* define(OpDef,$3`,' &B$1`,') */
/* include(../h/odefs.h) /* */
/* undefine(`OpDef') */
/* */
#else /* PreProcess */
#define OpDef(p,n,s) s, Cat(&B,p),
#include "::h:odefs.h"
#undef OpDef
#endif /* PreProcess */
0, 0
};
#endif /* StrInvoke */
/*
* Structures for built-in values. Parts of some of these structures are
* initialized later. Since some C compilers cannot handle any partial
* initializations, all parts are initialized later if any have to be.
*/
/*
* Built-in csets
*/
/*
* &ascii; 128 bits on, second 128 bits off.
*/
struct b_cset k_ascii = {
T_Cset,
128,
cset_display(~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
0, 0, 0, 0, 0, 0, 0, 0)
};
/*
* &cset; all 256 bits on.
*/
struct b_cset k_cset = {
T_Cset,
256,
cset_display(~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0,
~0, ~0, ~0, ~0, ~0, ~0, ~0, ~0)
};
/*
* &digits; bits corrosponding to 0-9 are on.
*/
struct b_cset k_digits = {
T_Cset,
10,
#if !EBCDIC
cset_display(0, 0, 0, 0x3ff, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0)
#else /* !EBCDIC */
cset_display(0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0x3ff)
#endif /* !EBCDIC */
};
/*
* Cset for &lcase; bits corresponding to lowercase letters are on.
*/
struct b_cset k_lcase = {
T_Cset,
26,
#if !EBCDIC
cset_display(0, 0, 0, 0, 0, 0, ~01, 03777,
0, 0, 0, 0, 0, 0, 0, 0)
#else /* !EBCDIC */
cset_display(0, 0, 0, 0, 0, 0, 0, 0,
0x3fe, 0x3fe, 0x3fc, 0, 0, 0, 0, 0)
#endif /* !EBCDIC */
};
/*
* &ucase; bits corresponding to uppercase characters are on.
*/
struct b_cset k_ucase = {
T_Cset,
26,
#if !EBCDIC
cset_display(0, 0, 0, 0, ~01, 03777, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0)
#else /* !EBCDIC */
cset_display(0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0x3fe, 0x3fe, 0x3fc, 0)
#endif /* !EBCDIC */
};
/*
* &letters; bits corresponding to letters are on.
*/
struct b_cset k_letters = {
T_Cset,
52,
#if !EBCDIC
cset_display(0, 0, 0, 0, ~01, 03777, ~01, 03777,
0, 0, 0, 0, 0, 0, 0, 0)
#else /* !EBCDIC */
cset_display(0, 0, 0, 0, 0, 0, 0, 0,
0x3fe, 0x3fe, 0x3fc, 0, 0x3fe, 0x3fe, 0x3fc, 0)
#endif /* !EBCDIC */
};
/*
* Built-in files.
*/
struct b_file k_errout = {T_File, NULL, Fs_Write}; /* &errout */
struct b_file k_input = {T_File, NULL, Fs_Read}; /* &input */
struct b_file k_output = {T_File, NULL, Fs_Write}; /* &outout */
/*
* Keyword trapped variables.
*/
struct b_tvkywd tvky_err = {T_Tvkywd, putint, {D_Integer}}; /* &error */
struct b_tvkywd tvky_pos = {T_Tvkywd, putpos, {D_Integer}}; /* &pos */
struct b_tvkywd tvky_ran = {T_Tvkywd, putint, {D_Integer}}; /* &random */
struct b_tvkywd tvky_sub = {T_Tvkywd, putsub}; /* &subject */
struct b_tvkywd tvky_trc = {T_Tvkywd, putint, {D_Integer}}; /* &trace */
/*
* Various constant descriptors.
*/
struct descrip blank; /* one-character blank string */
struct descrip emptystr; /* zero-length empty string */
struct descrip errout = {D_File}; /* &errout */
struct descrip input = {D_File}; /* &input */
struct descrip lcase; /* string of lowercase letters */
struct descrip letr; /* "r" */
struct descrip nulldesc = {D_Null}; /* null value */
struct descrip onedesc = {D_Integer}; /* integer 1 */
struct descrip ucase; /* string of uppercase letters */
struct descrip zerodesc = {D_Integer}; /* integer 0 */
/*
* The tended descriptors.
*/
struct descrip tended[6];
/*
* Run-time error numbers and text.
*/
struct errtab errtab[] = {
101, "integer expected",
102, "numeric expected",
103, "string expected",
104, "cset expected",
105, "file expected",
106, "procedure or integer expected",
107, "record expected",
108, "list expected",
109, "string or file expected",
110, "string or list expected",
111, "variable expected",
112, "invalid type to size operation",
113, "invalid type to random operation",
114, "invalid type to subscript operation",
115, "list, set, or table expected",
116, "invalid type to element generator",
117, "missing main procedure",
118, "co-expression expected",
119, "set expected",
120, "cset or set expected",
121, "function not supported",
122, "set or table expected",
123, "invalid type",
124, "table expected",
201, "division by zero",
202, "remaindering by zero",
203, "integer overflow",
204, "real overflow, underflow, or division by zero",
205, "value out of range",
206, "negative first argument to real exponentiation",
207, "invalid field name",
208, "second and third arguments to map of unequal length",
209, "invalid second argument to open",
210, "non-ascending arguments to detab/entab",
211, "by value equal to zero",
212, "attempt to read file not open for reading",
213, "attempt to write file not open for writing",
214, "input/output error",
215, "attempt to refresh &main",
216, "external function not found",
301, "evaluation stack overflow",
302, "system stack overflow",
303, "inadequate space for evaluation stack",
#ifdef FixedRegions
304, "inadequate space in qualifier list",
#endif /* FixedRegions */
305, "inadequate space for static allocation",
306, "inadequate space in string region",
307, "inadequate space in block region",
308, "system stack overflow in co-expression",
#if VMS
351, "insufficient MAXMEM limit",
#endif /* VMS */
#ifndef Coexpr
401, "co-expressions not implemented",
#endif /* Coexpr */
500, "program malfunction", /* for use by runerr() */
/*
* End of operating-system specific code.
*/
0, ""
};